package com.itheima.reggie.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

//public class EmployeeInterceptor implements HandlerInterceptor {

//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        HttpSession se = request.getSession();
//        Long id = (Long) se.getAttribute("employee");
//        if(id==null){
//            System.out.println("ip地址： " + request.getRemoteAddr());
//            System.out.println("request.getContextPath() = " + request.getContextPath());
//            response.sendRedirect(request.getContextPath()+"page/login/login.html");
//            return false;
//        }
//        return true;
//    }
//}
